      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          <ul class="nav nav-tabs mytabs">
		   <li class="active"><a href="#">分类编辑</a></li>
		  <li ><a href="<?=site_url()?>/category/index">分类列表</a></li>
		  <li  role="presentation"><a href="<?=site_url()?>/category/add"><i class="fa fa-plus"></i> 添加分类</a></li>
		 
		</ul>
          <div class="row">
            <div class="col-md-12">
              <div class="table-responsive">
               
                 <form role="form" id="templatemo-preferences-form" onsubmit="return false;">
                <div class="row">
                	<input type="hidden" id="id" value="<?=$category['id']?>" />
                  <div class="col-md-6 margin-bottom-15">
                    <label for="firstName" class="control-label">分类名称</label>
                    <input type="text" class="form-control" id="name" value="<?=$category['name']?>">                  
                  </div>
                  <div class="col-md-6 margin-bottom-15">
                    <label for="lastName" class="control-label">分类描述</label>
                    <input type="text" class="form-control" id="description" value="<?=$category['description']?>">                 
                  </div>
	              </div>	   
	              <div class="row templatemo-form-buttons">
	                <div class="col-md-12">
	                  <button type="submit" class="btn btn-primary" id="submit_btn">保存</button>
	                </div>
                </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
<script>
	$(document).ready(function() {
		$("#submit_btn").click(function() {
			var id = $("#id").val();
			var name = $("#name").val();
			var description = $("#description").val();
			$.ajax({
				url : '<?php echo site_url('category/save')?>',
				type : "post",
				async : true,
				data : {
					'id' : id,
					'name' : name,
					'description' : description
				},
				dataType : "json",
				success : function(data) {
					if(data.code)
					{
						alert(data.msg);
					}else{
						alert(data.msg);
					}
					
				}
			});
		});
	}); 
</script>